package com.edmendst.xmall.dto;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class OrderItem {
    //返回字段
    private String orderId;
    private Integer userId;
    private BigDecimal productPrice;
    private String productName;
    private Integer quantity;
    private Integer orderPaymentStatus;
    private Integer orderDeliveryStatus;
    private  String message;
    private String productImage;

    //    order_tracking_number	VARCHAR(100)	-	空字符串	物流单号
//    order_create_time	TIMESTAMP	-	CURRENT_TIMESTAMP	创建时间
//    delivery_info JSON NOT NULL COMMENT '完整配送信息快照',
//product_price	DECIMAL(10,2) UNSIGNED	非空	-	价格

    private String orderTrackingNumber;
    private String orderCreateTime;
    private String deliveryInfo;
    private BigDecimal orderTotalAmount;
    private String orderReceivedTime;
    private Integer orderReceivedStatus;

    private Integer productId;

    // 新增字段接收 items
    private List<OrderItemDetail> items;



    @Data
    public static class OrderItemDetail {
        private String productName;
        private Integer quantity;
        private String productCoverImage;
    }


    public OrderItem() {
    }
    public OrderItem(String orderId, Integer userId, BigDecimal productPrice, String productName, Integer quantity, Integer orderPaymentStatus, Integer orderDeliveryStatus,Integer orderReceivedStatus, String productImage,Integer productId) {
        this.orderId = orderId;
        this.userId = userId;
        this.productPrice = productPrice;
        this.productName = productName;
        this.quantity = quantity;
        this.orderPaymentStatus = orderPaymentStatus;
        this.orderDeliveryStatus = orderDeliveryStatus;
        this.productImage = productImage;
        this.productId = productId;
        this.orderReceivedStatus = orderReceivedStatus;
    }
}
